package com.lanhang.controller;

import com.lanhang.entity.Student;
import com.lanhang.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService studentService;
    @GetMapping("/list")
    /*public String list (Model model){
        List<Student> students=studentService.findAll();
        model.addAttribute("students",students);
        return "student/list";
    }*/
    public List<Student> list(){
        return studentService.findAll();
    }
}
